Page({
  data: {
    userId: "",
    nickName: "",
    bottomPadding: 0
  },
  onLoad(option) {
    wx.setNavigationBarTitle({ title: `${option.nickName}的主页` });
    wx.showShareMenu({
      withShareTicket: true, // 是否使用带 shareTicket 的转发
      menus: ["shareAppMessage", "shareTimeline"], // 需要显示的分享按钮
    });
    this.setData({
      bottomPadding: getApp().globalData.bottomPadding,
      userId: option.userId,
      nickName: option.nickName,
    });
  },
  onShareAppMessage(res) {
    return {
      title: `${this.data.nickName}的主页`,
      path: `/pages/home/otherProfile/index?userId=${this.data.userId}&nickName=${this.data.nickName}`,
    };
  },
  async onPullDownRefresh() {
    let profile = this.selectComponent('#profile')
    profile.pullDownRefresh()
  },
  async onReachBottom() {
    let profile = this.selectComponent('#profile')
    profile.reachBottom()
  }
});
